<template>
        <van-loading size="24px" v-if="loading">加载中。。。</van-loading>
     <div class="banner" v-else>
      <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
        <van-swipe-item v-for="item in banner" :key="item.id">
          <img :src="item.picUrl" alt />
        </van-swipe-item>
      </van-swipe>
      <ul class="nav">
        <li>
          <img src="/static/tu1.png" alt="">
          <p>签到</p>
        </li>
        <li>
          <img src="/static/tu2.png" alt="">
          <p>礼券</p>
        </li>
        <li>
          <img src="/static/tu3.png" alt="">
          <p>砍价</p>
        </li>
        <li>
          <img src="/static/tu4.png" alt="">
          <p>专栏</p>
        </li>
      </ul>
    </div>
  
</template>

<script>
export default {
  components: {},
  props: {},
  data() {
    return {
      banners: [],
      loading:true
    };
  },
  watch: {},
  computed: {},
  methods: {},
  created() {
    this.http.get("https://api.it120.cc/small4/banner/list").then(msg => {
      // console.log(msg);
      this.banner = msg.data.data;
      // console.log(this.banner);
      this.loading = false
    });
  }

};
</script>

<style lang="less" scoped>
.banner {
  width: 5.2rem;
  position: relative;
}
.my-swipe {
  width: 5.2rem;
  height: 5.2rem;
}
.my-swipe .van-swipe-item {
  width: 5.2rem;
  height: 5.2rem;
  color: #fff;
  font-size: 1rem;
  line-height: 1.5rem;
  text-align: center;
  background-color: #ffffff;
}
.my-swipe .van-swipe-item img {
  width: 5.2rem;
  height: 5.2rem;
}
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  background-color: #39a9ed;
}
.nav {
  width: 5.2rem;
  height: 1.4rem;
  display: flex;
  justify-content: space-around;
  position: absolute;
  left: 0;
  bottom: -0.01rem;
  background: white;
  border-bottom: 0.02rem solid rgb(216, 215, 214);
  border-radius: 20% 20% 0 0;
}
.nav li {
  display: flex;
  flex-direction: column;
  text-align: center;
  justify-content: center;
}
.nav li img {
  width: 0.5rem;
  height: 0.5rem;
}
.nav li p {
  margin-top: 0.2rem;
}
</style>